package com.shiyan.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.plugins.PerformanceInterceptor;

@Configuration
//扫描dao或者是Mapper接口
@MapperScan("com.shiyan.demo.mapper*")
public class MybatisPlusConfig {
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor page = new PaginationInterceptor();
        page.setDialectType("mysql");
        return page;
    }
    
    @Bean
    public PerformanceInterceptor performanceInterceptor(){
    	PerformanceInterceptor page = new PerformanceInterceptor();
        page.setFormat(true);
        return page;
    }
}
